home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
HENSA
/
GRAPHICS
/
MERLIN
/
DOCUMENT.TXT
next >
Wrap
Text File
|
1995-11-23
|
55KB
|
1,032 lines
Creating objects
Basics
You have three views of the scene in which you can create objects. These are views from the front, right and top. As
a window is a 2D representation of 3D space you need a way to specify the third dimension in your construction. For
instance, from the front view right is the x axis, up is the y axis, and the z axis is into the screen. In this program the
problem of the "depth" has been solved with "creation planes". With these you have two ways of defining the depth of
an object.
Creation planes
The creation plane icons are at the right end of the toolbox. They specify the position of the invisible plane in which a
new object is created. For example: if you do your construction on the front view then the z-axis will be used to
determine the depth of the object into the screen. The other two creation axes will be shown as dotted lines.
Depth equals width
This is the default mode picked if you click select on the toolbox icons. This means that the width that you drag with
the mouse will equal the depth of the object.
Depth equals height
This mode is chosen when clicking with adjust on the toolbox icons. This means that the height that you drag with the
mouse will equal the depth of the object.
Standard objects (Spheres, Cubes, Cylinders, Cones and super quadrics)
To create one of these objects you simply drag a bounding box to the required size in one of the front, right or top
windows.
Cylinders & Cones
When creating cylinders or cones you can alter the upper radius of the cylinder in the parabox, if it is open.
Super quadrics
Super quadrics are a mixture of cubes and octahedrons. In the parabox you can specify how close they are to one of
these objects. A value of 1 will be a octahedron. A value of 2 will be a sphere and above 2 it will get closer to a
cube.Anywhere between 1 and 2 and the object will look like a box with smoothed edges.
Planes
Planes are created immediately with the first mouse click on the window. They are created horizontally.
Lights
Spot lights
A spot light is a point light source. The light produces shadows with sharp edges. Spot lights are created with a simple
click on the window.
Extended lights
Extended light can be described as a sphere that emits light - these are much more similar to light bulbs than spot
lights. They produce shadows with "fuzzy" edges (penumbrae). The images produced using extended light sources
are usually superior to those produced with point lights, but ray-tracing time is increased substantially. [Anti-aliasing
must be used to produce error-free pictures Rather than tracing one shadow ray to a light source, multiple rays are
traced to various points on the extended source. The extended source is approximated by sampling a square grid
light sources.] To create an extended light you must drag it's radius on the window.
Directional lights
A directional light is similar to sun light. The light comes from the same direction everywhere in the scene. The actual
position of the light is unimportant and is shown in the editor only for display reasons. To create a directional light you
must drag it's lighting direction on the window.
Miscellaneous objects
These are various stars, tetrahedrons, octahedrons, icosahedrons and dedocahedrons. If you click on the icon with
the question mark a menu will appear from which you can choose which object to create. Some of the objects can be
customised when you click the menu button over the misc object icon. The objects are created with a simple click on
the window.
Polygons
To create polygons you must first select the polygon icon on the toolbox. If instead of the select mouse button you
click with adjust you will create simple lines. You can change the mode during a creation process. You position the
corners of the polygon by clicking in the view window a number of times.
Select click
When clicking with the select button you create a point of the polygon.
Adjust click
When clicking with the adjust button you will delete the last point created.
Double click select
With a double click of the select mouse button the polygon will be finished.
The Parabox
The parabox has two purposes creation of objects by typing in their dimensions or limiting the dimensions of new
objects by fixing certain values.:
Creation of objects
You can type in the desired values into the writable icons and when you press return in the last icon of the parabox
the new object is created. If the parabox isn't already displayed then you have to switch it on with "Ctrl P" or selecting
the icon on the toolbox.
Fixing certain values
When you are creating objects with the mouse, you can fix some dimensions to the displayed values in the parabox.
You should type the desired value into the appropriate box and click on the button beside it so that it turns from green
to red. This value will not be changed while dragging the mouse creating a new object.
Translating points
When clicking on thetranslate points icon on the toolbox, you are able to move single or groups of points which are
part of polygons.
Select click
This selects the nearest point found under the mouse pointer. It automaticallydeselects all other points.
Adjust click
The nearest point found under the mouse pointer is added to the selection. If you click on a point that is already
selected, then it is deselected.
Adjust drag
This moves all selected points to the new position. You don't need to start the drag over an object that is selected.
Selection tool
Select click
This selects the first object found under the mouse pointer. It automatically deselects all other objects.
Select double click
This selects the next object which is found under the mouse pointer. It automatically deselects all other objects.
Select drag
This selects all object which touch the rectangle you have dragged. It automatically deselects all other objects.
Adjust click
The first object found under the mouse pointer is added to the selection. If you click on an object that is already
selected, then it is deselected.
Adjust double click
The next object in relation to the current selected one found under the mouse pointer in relation to the current
selected one is added to the selection.
Adjust drag
This moves all selected objects to the new position. You don't need to start the drag over an object that is selected.
Zoom tool
Select click
If you click with select on the zoom tool on the tool box, the zoom window is opened. There are some preset zoom
values which scale the view by the given amount. The button "Show all" will calculate a zoom value which will allow
you to see all objects currently in the scene - without changing the window size. It will also set automatically the scroll
bars to center the image in the window.
If you click with select on the buttons then the zoom factor is altered first and you must click on the "OK" button to
activate the new zoom value. If you click with adjust then the new value is activated immediately.
Adjust click
If you click with adjust, then nothing immediately happens, but you can then drag a rectangle on the view window to
select an area of screen which you want to zoom into.
Multicopy tool
With the multicopy tool you are able to copy objects in the several ways. You should select all objects you want to
copy with the selection tool and then click on the multicopy icon. A window pops up allowing you to pick between the
following methods:
Linear copy
This is the simplest choice of the multicopy tool. It simply adds a given value to the position of the object. You have to
specify how many times this is done and to which axis the value is added.
Trapezoid copy
With this option you can copy all selected objects into a rectangle or trapezoid shape. You must specify the width and
the length of the rectangle and if you want to have a trapezoid shape you must change the angle from 90°.
Furthermore you must give the number of intermediates between the edges of the rectangle. "0" means that only at
the edges are objects copied to. The objects are always copied into the plane depending on which view window is
active.
Circular copy
This option copies the selected objects into a circle of the specified radius. This copy also depends on the window last
opened, so you will always see the circle from the front. You must specify the angle which is added by each copy to
the position of the objects according to the center of the circle. You can give also an offset in the three axes which is
added each time the selection is copied. You can also choose whether the objects are to be rotated according to their
position in the circle or if their orientation stays as in the original position.
Globular copy
This option copies the objects into a sphere shape. You give the radius of the sphere and the angle between the
objects. You can also choose whether the objects are rotated according to their position in the sphere or if their
orientation stays as in the original position. The globular copy is independent of which view window is active.
List tool
The list window shows you all the objects in the scene. Lights are printed in yellow, groups in dark green and all other
objects in black. On the right of the object's name its attributes are shown. These are "H" for hidden, "D" for double
sided, "P" for phong shaded. The three numbers that follow are the middle of the object.
You can open a group by double clicking on the group's line. The first icon shows the group path and the objects in
the group are shown in the list field. If you want to close the group you must click on the group path.
You can also select objects in the list window by clicking on their row with adjust. So you can select also objects which
are part of a group to alter its surface.
Measure tool
The measure tool measures distances in the view window. This is helpful when you need to set some parameters eg.
in the multicopy window. To do this you first select a writable icon where you need the value. This is simply be done
by clicking with the mouse into it, so that the caret is shown in the icon. Then use the key shortcut "Ctrl -" to activate
the measure tool. Drag now the distance on the window, which you want to know. After finishing the drag the value is
written into the icon you have selected.
Mirror tool
With the mirror tool you can reflect an object in a plane. Before you can use this tool you must select all objects which
you want to reflect. When you click on the mirror icon on the toolbox, a window appears. You have to decide what the
plane of reflection is and at what distance the reflection is done to the outmost point of the selection.
Sweep tool
The sweep tool takes a polygon and rotates it through 360° creating an object which looks like it has been lathed. This
is the same as a mathematical volume of revolution. Sweep objects are no more than a number of cones end to end.
As an alternative to cones you can approximate the lathed object with a large number of triangles - however this uses
alot more memory and the objects generated aren't as smooth.
Connect tool
The connect tool takes two polygons and joins them with a ribbon of triangles. Select the two polygons using any of
the methods mentioned and click on the connect tool icon. The connect tool can be called automatically during
drawfile import in order to create a shaped tube of triangles.
Thickening tool
The thickening tool turns a flat polygon into a three dimensional object by adding sides and a back to the shape.
Select the polygon to thicken and then click on the thickening tool icon. An option window is displayed in which you
can enter the thickness of the new group object.
View types
You have three different editing view windows: front, right, top and 3D view. You change views by clicking on the
correct button on the tool box. Usually only one view is displayed at one time, but you can have more than one view
on screen if you click with adjust on the view icons. If you hold down the shift key while clicking on the view icons, you
will look on the scene from the opposite site.
Objects can only be created in the plane views like front, right and top and not the 3D view.
When you do a drag on the 3D view you can change the angle and the distance of the observers view. Use a select
drag to change the angle and an adjust drag up or downwards to change the distance.
3D View
In the 3D view window you can change the view position by dragging on that window. With a select drag you can
rotate the scene and with a adjust drag you can alter the distance to the view point. Dragging downwards will move
nearer to the center and dragging upwards will move away.
Display modes
Line mode (F9)
In the line display mode you can see through all objets. Only the outlines of the polygons are displayed.
Hidden line mode (F10)
In the hidden line display mode the polygons behind a polygon are hidden. This gives already a good 3D feeling of the
scene. In addition to this polygons which are far behind are shaded to visualise the distance between them.
Gouraud display mode (F11)
In this display mode all polygons and lines are displayed with an approximated colour. For this the specular and the
ambient colour are taken into account. A minimum of one light must be set before this mode can be used (else
everything would appear totally black). Shadows are not calculated, so all objects appear as if they are in full light -
whether or not they are shadowed.
Camera setting
If you click on the camera in the toolbox, you can set the camera (or view point) position and angle. The position of
the camera will be shown in the open window together with its position. The field of view is also shown with a triangle,
starting at the camera's lens. You can simply change the camera's position by dragging with the select button on view
window. The view angle of the camera can be changed by dragging with adjust.
After a change the camera will be automatically recentered in the view window and the objects will be redisplayed
according to the new position of the camera.
A preview of the actual picture which is taken by the camera can be seen in the 3D view window.
Material editor
To get a photorealistic image out of a 3D scene you must choose appropriate surfaces to represent the desired
materials. You must be very careful in choosing the colours, transparency, reflection and other values. All these can
change the resulting image significantly. You can have the most wonderful 3D data, but if you choose poor surface
attributes you will get a dull and uninteresting picture.
To define the surface of each object you must use the material editor and what stands behind it.
Material handling
There is a list of materials used in a scene. When you create an object a standard material, with the internal index of
zero, is automatically applied to that object. This will always be the first material in the list. Different objects can share
one material. If you want to change an object's material and it is shared by several other objects you must decide if
want to change the surface of all objects which use that material or if you want to create a new material just for the
selected object. If you chose "new" then only the selected objects will have the new material. Otherwise all objects
which shared that material will have the changed material attributes. If you have selected an object that has a shared
material then the button "New" is shown on the material organiser window. Otherwise it will be faded.
Material editor main window
Several materials are predefined for your convenience. You are not limited to these surfaces but you may wish to use
them whilst learning how to use the editor.
Choose predefined material
To choose a material you can use the arrow buttons or click on the pop-up menu button. This will let you select from
all the predefined materials.
Change predefined material
If you want to change a predefined material or simply want to create your own then click on the sample picture of the
current material. This will open the material window. See "Change material".
Add a material
If you have created a material definition which you would like in the predefined list, you must choose "add" in the
material editor menu. A window opens up in which you can type the name of the new material. Furthermore you must
choose a subdirectory to put it in. You will find a list of the current ones when clicking on the list icon besides the
directory icon. If you want to add a new subdirectory you must type the name into the writable icon and click on the
add button. For the correct picture to be displayed for the new material in the same way as the predefined material
you must trace it first. You trace the new material by selecting "Trace" in the menu and then !Merlin produces the
picture. You must then copy the picture into the appropriate directory in !MerlinDat.Textures . The sprite must have the
same name as it's name in the definition. The sprite must have 200 by 200 pixels and a maximum of 256 colours.
Delete material
To delete a material from the list of predefined materials you must choose "delete" on the material editor menu. You
then pick the material from a menu with the material directories. If you delete a material which is the last in the
directory the directory will be removed too.
Trace material
If you have changed the parameters of a material and you want to see how it looks you can choose "trace" in the
material editor menu. This will trace the current material on a sphere on a plane. Here you should take into account
that the appearance of a surface may change significantly according to its environment. Due to this the background
colour of the sample trace is taken from the actual environment setting.
In the first window of the material editor you can choose one of the predefined materials. You can add or delete a
material to or from the list. You can also trace an edited material to see how the changes look.
Change Material
To get to this window you must click on the material sample picture. The material window shows you the current
material setting. On the top you will find the values for reflection and transparency and also the colour setting. Below
that you will see if any texture is applied to the surface. There can be a maximum of two textures for one surface,
whereby the second will be always dominant.
If you want to change the values you must click on the pictures what will lead you into the next window.
Change Surface
In this window you can choose the main surface attributes.
Transparency
The value given here will determine how much of a ray goes through the object. A value of 0% will be a surface that
isn't transparent at all. Whereas a value of 100% will be a surface that is totally transparent. A value of 100% should
only be taken if a texture is applied to the surface.
Index of refraction
If a light ray hits a transparent object it will be refracted. That means its direction will be changed giving an optical
illusion. The light ray stays going in the same direction if it hits the surface perpendicular. The higher the density the
higher the refraction will be. A value higher than 1 will be an object with higher density and a value lower than 1 will be
an object with lower density. A value of one will mean that the ray is not refracted when going through the object.
Reflection
This value will set the percentage of a ray that is reflected on the surface. O% gives totally matt objects and 100%
gives totally shiny objects.
Diffuse colour
The diffuse colour is the main colour of the surface. To determine the colour of each pixel on screen the raytracer
program mainly uses the colour of the object, the brightness of the light, and the angle the light hits the surface. [It
finds the angle by using the dot product of the incoming ray and the surface normal at the point of intersection.]
Specular colour
This colour simulates specular reflections of light sources on the surface of the object. These are the shiny circles of
light seen in the reflections picture above.
Specular coefficient
The specular coefficient, a floating-point number, controls the appearance of the specular colour. The larger coef is,
the smaller highlights will be. A value of 50 or so is suitable for highly polished surfaces, whereas a cloth or paper-like
material would have a coef of 0 to 2. A value of zero will turn off the specular colour. [It indicates the power to which
the dot product of the surface's normal vector at the point of intersection and the vector to each light source should be
raised. This number is then used to scale the specular colour of the surface, which is then added to the colour of the
ray striking the surface.]
Ambient colour
This colour simulates background lighting. This colour is always applied to a ray striking the surface. If you have a
scene with only one light source and there is a shadow the shadow will be black. But if you set the ambient colour to
something else than black then the shadow will become that colour.
Translucent & Specular transmission coefficients
The optional parameters translucent and specular transmission coefficients may be used to give a surface a
translucent appearance. If translucent is non-zero and a light source illuminates the side of the surface opposite that
being rendered, diffuse lighting calculations are performed with respect to the side of the surface facing the light, and
the result is scaled by translucent and added to the colour of the incident ray. Thus, translucent accounts for diffuse
transmission of light through the object. Specular transmission coefficient is similar to specular coefficient, but it
applies to the specular transmission of highlights. Note that in both cases the index of refraction of the surface is
ignored. By default, surfaces have zero translucency. Note that if these optional parameters are used, then they must
both be present.
Change Texture
Textures in raytracers are modifications to the appearance of an object so that it looks like it has a particular texture.
They do not actually change the physical location of a surface - so for instance a bump texture makes a surface
appear with bumps but there are no real bumps on the surface.
To add a texture to the surface you need to activate the texture in the material window. Then click on the sample
picture to open the texture window. Here you can choose between various texture types, parameters and eventually
also colour maps. Each texture can also be scaled, rotated and translated. Scaling of textures is very useful as you
can achieve different effects with the same texture. Rotation and translation is mainly useful with the textures checker,
tile and bitmap.
Blotch
... produces an interesting blotchy-looking surface in which the main colour is mixed with a new colour. A value of 0
results in a roughly 50-50 mix of the two surfaces. Higher values result in greater instances of the 'default' surface
type. [The blend factor is used to control the interpolation between a point's default surface characteristics and the
characteristics of the blotch surface.]
Bump
... applies a random bump map to the surface being textured. [The point of intersection is passed to DNoise(). The
returned normalized vector, weighted by scale is added to the normal vector at the point of intersection.]
Checker
... applies a (3D) checkerboard texture to the object being textured. Every point that falls within an "even" cube will be
shaded using the characteristics of the named surface. Every point that falls within an "odd" cube will retain its usual
surface characteristics. Be warned that strange effects due to roundoff error are possible when the planar surface of
an object lies in a plane of constant integral values in texture space. Anti-aliasing is recommended with this texture
type.
Crack
... puts cracks into the surface - a value of 0 applies no texture, 0.1 gives a good crack appearance through to about
1.2 which totally covers the object with surface surf_name
FBM
... generates a sample of discretized fractional Brownian motion (fBm) and uses it to modify the diffuse component of
an object's colour. If no colourmap is used, the sample is used to scale the object's diffuse colour. If a colourmap is
given, a 256-entry colourmap is read from the named file, and the object is coloured using the values in this
colourmap (see below).
Scale is used to scale the output of the fractional Brownian motion function.
Offset allows one to control the minimum value of the fBm function.
H is related to the holder constant used in the fBm (a value of 0.5 works well).
Lambda is used to control the lacunarity, or spacing between successive frequencies, in the fBm (a value of 2.0 will
suffice).
Octaves specifies the number of octaves of Noise() to use in simulating the fBm (5 to 7 works well).
Thresh is used to specify a lower bound on the output of fBm function. Any value lower than thresh is set to zero.
FBMBump
... is similar to the fBm texture. Rather than modifying the colour of a surface, fBmBump acts as a bump map.
Marble
... gives a surface a marble-like appearance. If a colourmap is used, the marble will be coloured using the RGB values
in the colourmap. If no colourmap is given, the diffuse component of the object's surface is simply scaled. One may
transform the texture to control the density of the marble veins.
Mottle
When scaled small this texture applies a mottled texture to the object. When scale larger a blotchy agate type surface
will result.
Rough
A value of 1 makes the surface glossy and 0 makes the surface very rough.
Sky
Similar to fbm, but rather than modulating the colour of the surface it modulates the transparency. assume the fbm
function returns a value between 0 and 1. Cthresh is the value above which the surface becomes totally opaque.
Lthresh is the value below which the surface becomes totally transparent. Note that for this to work, the ray maxdepth
must be greater than one, and the surface to be modulated must have a valid refractive index - normally 1.
Spot
Applies a spotty texture to the surface. a small value of n (0.1) applies small spots of the texture surface. Larger
values will make the spots merge until only spots of the original surface remain.
Tile
The tile texture works similar as the checker texture. But the tile texture inserts separate squares to the surface. This
works as follows: There are two parts: the original surface and the surface of the tile. The length of the original is
always 1. In addition to that there is the tile surface which length you specify with the index value. So if you set it to 1
it has the same length as the original part.
Wood
This texture gives a wood-like appearance to a surface. An example of this texture is given in the scene 'varnshteak'.
Bitmap
With bitmap texture you can project a sprite onto a surface. This works like a film projector. You will need to change
the angle of the projection to get the desired effect. The image is an acorn format sprite and needs the palette to be
present. In the case of a 256 colour image the palette is not needed, as the default colours are used. The image is
mapped 'through' the object so if viewed from behind a mirror image will be seen. The image is taken to be of unit size
in the x-z plane. Transformations ( in particular scale and rotate ) will normally be necessary to texture the object as
required.
Environment setting
In this window you can set all environmental effects of the scene.
Background colour
This will set the colour which will be given to any ray which does not hit any object. This is not the same as a
background light. So if you set the background colour to white you still need a separate light object.
Aperture radius
... is the radius, in world units, of the camera hole centered at the eye point. Together with the focal distance this
controls the depth of field, and thus how out of focus the image will be. Rays are cast from various places on the
aperture disk towards a point which is focal distance units away from the center of the aperture disk. This causes
objects which are focal distance units from the eye point to be in sharp focus. Note that an aperture radius of zero
causes a pinhole camera model to be used, and there will be no blurring (this is the default). Increasing the aperture
radius leads to increased blurring. When using a non-zero aperture radius, it is best to use jittered sampling in order
to reduce aliasing effects.
Focal distance
... specifies the distance, in world units, from the eye point to the focal plane. Points which lie in this plane will always
be in sharp focus. By keeping the aperture radius constant and changing focal distance, it is possible to create a
sequence of frames which simulate pulling focus. By default, focal distance is equal to the distance from the eye point
to the look point.
Field of View
The horizontal field of view specifies the angle, in degrees, between the left-most and right-most columns of pixels in
the final image. The vertical field of view specifies the angle between the center of the top-most and bottom-most row
of pixels. The relation of the horizontal to the vertical field of view should always correspond to the tracing resolution
(eg. 800 by 600 equals ratio 1.333 so a horizontal field of view of 60° requires a vertical field of view of 60° / 1.333 =
45°).
Line thickness
The line thickness set the default line thickness. These thickened lines are represented in the trace output as
cylinders with the specified radius. The line thickness specified in the environment window will also be used for the
conversion of polygons to lines.
Fog
Here you can put a fog effect into scene. You must choose a colour for the fog (usually white)and the thickness of the
fog.
Fog is simulated by blending the colour of the fog with the colour of each light ray. The higher the value the thinner
the fog will be. Values between 10 (thick fog) and 1000 (thin fog) work well. [The amount of fog colour added to each
ray is an exponential function of the distance from the ray origin to the point of intersection. If the distance divided by
thickness is equal to 1, a ray's new colour will be half of the fog colour plus half its original colour.]
Setting attributes
Phong shaded
This switches the objects shading from flat shading to phong shading in the tracer. This will remove any hard edges
form the object as all edges will be smoothed. This works only for groups of polygons. In the editor these objects will
be displayed with gouraud shading, which will give a slightly different appearance compared with the traced image.
You can use key shortcut CTRL J to switch it on and CTRL Y to switch it off.
Double sided
This will enable you to see polygons from both sides. Normally the polygons can be seen only from the side from
which the points of the polygon appear in clockwise order. This option will not affect the tracing output.
You can use key shortcut CTRL Q to switch it on and CTRL O to switch it off.
Hidden
This option will hide any object selected. The use of this is mainly to speed up redraw time if you already have a big
scene but don't need to display all objects for construction work.
You can use key shortcut CTRL H to switch it on and CTRL G to switch it off.
Configure Merlin editor
Colours
Here you can set the colours for the background, lines, selected objects, axis and grid. Click on the surface where the
colour is displayed and a colour picker will appear.
Display
Here you can choose if the toolbox and the parabox is displayed at standard. For the parabox you can even decide if
it is displayed at the lower right, the upper right, the upper left or the lower left of the window.
Draw file import
Drawfiles can contain continuous Bezier curves. The editor cannot handle these directly - but has to approximate the
curves to a number of straight lines. By default each bezier curve is split up into 8 straight lines, but when you have a
few large complex curves you may wish to raise this value. When you have many small curves fewer lines may be
needed. Remember however that the higher the number of points in your polygons the more memory required.
Auto save
If you want you files to be saved automatically then you must change this value to something other than zero. The
value gives the time between automatic saves in minutes. The file is saved as "Autosave" in the !MerlinDat directory
and not using the filename you might have loaded.
Special menu
Poly to Line
Here you can transform an object made of solid surfaces into a line object. Only the borders of the polygons will be
displayed and the line thickness will be taken from the current setting in the environment window. Even spheres,
cylinders and other objects can be transformed. This operation cannot be reversed.
Turn polygon
In the editor a polygon can only be seen, when it's points are in clockwise orientation according to the viewer. This
needs to be true for the tracer to render the polygons correctly, otherwise only the ambient colour will be shown. If you
have problems with polygons not appearing correctly you can change its orientation so that it will be flipped over and
seen from the opposite site.
Connect points
This function enables you to connect points from different polygons together. You must select the points you wish to
join. The first selected point stays where it is and the others are moved to that location. You can select as many points
as you want at one time. After the points are joined then they stay together when moved around.
Set axis
This function will set the creation axis to the position of the first selected point. This should be done when you want to
create a polygon which will be connected with the connect point function or should use points of other polygons.
Configure Merlin tracer
In the iconbar menu you will find the entry "configuration". Here you can set the different trace types (Preview 1,
Preview 2, Trace 1, Trace 2) which are used by the editor. You switch from one to the other by clicking on the icon
after "Tracetype". When clicking on the "save" button the current displayed trace type will be saved.
Image size
With the image size you define the resolution in which the picture will be traced. You can choose one of the presets or
set a user defined resolution. The ratio between the x / y resolution must correspond with the ratio of the field of view,
otherwise the picture is stretched. Remember that the trace time rises by the factor four when the resolution doubles
(eg. from 160 x 120 to 320 x 240).
Trace Type
Here you can choose between scanline and multipass mode. In the scanline mode each line of the picture is
calculated sequentially. Multipass is probably best for previewing a picture and Scanline best for the finished scene.
In the multipass mode the picture is calculated out of a grid, which gives you the opportunity to see how the picture
will look like much earlier than in scanline mode.
Options
Display Report
When this option is switched on a status report is displayed which gives information about the time taken, estimated
time, calculated rays and so on. This window is updated during tracing.
Display Image
When this option is selected the traced image is displayed in a window.
Blank Screen
This option affects only pre-RiscPC machines as this switches off the VIDC display, which maximises the processor
power for the tracing process. There will be nothing on the screen to show that the computer is still working - but the
screen will be restored on moving the mouse or pressing a key.
Multitask
Here you can choose between multitasking tracing and single-tasking. In single-tasking the tracing process is much
faster, but you will not be able to do any other work. [In actual fact the single-tasking mode the raytracer does not use
100% of the cpu time. Every few seconds it lets other programs in the desktop run so you may find that you are able
to do some things - but very very slowly.]
Settings
Anti-aliasing
Two types of anti-aliasing are supported: "adaptive subdivision" and "jittered sampling". Anti-aliasing smooths high
contrast edges. For example if you have a white polygon on a black background. If you don't use anti-aliasing you will
see a grid at the border of the polygon. With anti-aliasing this will be smoothed. On pictures with low contrast you will
not notice a great difference when using anti-aliasing and when not.
Adaptive subdivision works by sampling each pixel at its corners. The contrast between these four samples is
computed, and if too large, the pixel is subdivided into four equivalent sub-pixels and the process is repeated. The
threshold contrast may be controlled via the contrast command. There are separate thresholds for the red, green, and
blue channels. If the contrast in any of the three is greater than the appropriate threshold value, the pixel is
subdivided. The pixel-subdivision process is repeated until either the samples' contrast is less than the threshold or
the maximum pixel subdivision level, specified via the adaptive command, is reached. When the subdivision process
is complete, a weighted average of the samples is taken as the colour of the pixel. The adaptive anti-aliasing is an
intelligent process as it is only performed when the contrast is high between two pixels. Like this it will not take much
more time on a low contrast picture than without anti-aliasing.
Jittered sampling works by dividing each pixel into a number of square regions and tracing a ray through some point
in each region. The exact location in each region is chosen randomly. The number of regions into which a pixel is
subdivided is specified through the use of the samples command. The integer following this option specifies the
square root of the number of regions.
While jittered sampling is generally slower than adaptive subdivision, it can be beneficial if the penumbrae cast by
extended light sources take up a relatively large percentage of the entire image or if the image is especially prone to
aliasing.
Each area light source is, in effect, approximated by a square grid of light sources. The length of each side of the
square is equal to the diameter of the extended source. Each array element, which is square in shape, is in turned
sampled by randomly choosing a point within that element to which a ray is traced from the point of intersection. If the
ray does not intersect any primitive object before it strikes a light source element, there is said to be no shadow cast
by that portion of the light source. The fraction of the light emitted by an extended light source which reaches the point
of intersection is the number of elements which are not blocked by intervening objects divided by the total number of
elements. The fraction is used to scale the intensity (colour) of the light source, and this scaled intensity is then used
in the various lighting calculations.
When jittered sampling is used, one shadow ray is traced to each extended source per shading calculation. The
element to be sampled is determined by the region of the pixel through which the eye ray at the top of the ray tree
passed.
When adaptive supersampling is used, the samples command controls how many shadow rays are traced to each
extended light source per shading calculation.
Specifically, each extended source is approximated by a square array consisting of samples * samples elements.
However, the corners of the array are skipped to save rendering time and to more closely approximate the circular
projection of an extended light source. Because the corners are skipped, samples must be at least 3 if adaptive
supersampling is being used. Not that the meaning of the samples command is different depending upon whether or
not jittered sampling is being used.
Sample level
The sample level determines the quality of the anti-aliasing. The higher the number the higher the quality of the
image. Default is 2. Remember that the trace time can rise by the square of the sample level.
Storage Format
Internally in the Merlin raytracer, scenes are stored by one of two means. By default, the primitive objects which
make up a scene are stored in a simple list. When a ray is intersected with such an object, the ray is tested for
intersection with each object in the list. While the list is the default method of object storage, one may emphasize this
fact in the input file by including the list keyword somewhere within the object-definition block.
The second form of internal object storage is the three-dimensional grid. The grid's total size is calculated by Merlin
and is equal to the bounding box of the entire World object. A grid subdivides the space in which an object lies into an
array of uniform box-shaped voxels. Each voxel contains a linked-list of objects and primitives which lie within that
voxel. When intersecting a ray with an object whose constituents are stored in a grid, the ray is traced incrementally
from voxel-to-voxel, and the ray is intersected with each object in the linked list of each voxel that is visited. In this
way the intersection of a ray with a collection of objects is generally made faster at the expense of increased storage
requirements.
Ray Maximum Depth
Controls the maximum depth of the ray tree, ie the number of times a ray can hit surfaces before it is ignored. The
default is 3, with eye rays considered to be of depth zero. This value needs to be raised if you have a lot of reflecting
or transparent surfaces in the scene. For instance, if you have 5 glass objects in the scene and you want to see
through these then you must set the value to a minimum of 5. If set to 0, no reflection or refraction rays will be traced.
Cutoff Contribution
Specifies the adaptive ray-depth cutoff threshold. When any ray's maximum contribution to the final colour of a pixel
falls below this value, the ray and its children (specularly transmitted and reflected rays) are not spawned. The default
value is 0.001.
Contrast RGB
Specifies the maximum allowed contrast between samples in a (sub)pixel before subdivision takes place. The
contrast RGB is only used with anti-aliasing adaptive. The contrast may be used to decrease the number of instances
in which pixels are subdivided. Using these options, one may indicate the maximum normalized contrast which is
allowed before supersampling will occur. If the red, green or blue contrast between neighbouring samples (taken at
pixel corners) is greater than the maximum allowed, the pixel will be subdivided into four sub-pixels and the sampling
process will recurse until the sub-pixel contrast is acceptable or the maximum subdivision level is reached. The
defaults for the red, green and blue channels are 0.25, 0.2, and 0.4, respectively.
Field of View
The horizontal field of view specifies the angle, in degrees, between the left-most and right-most columns of pixels. If
present, the vertical field of view specifies the angle between the center of the top-most and bottom-most row of
pixels. If not present, the vertical field of view is calculated using the screen resolution and the aspect ratio of the
pixels in the mode selected for tracing. The default horizontal field-of-view is 45 degrees, while the default vertical
field-of-view is calculated as described above.
Trace Options
Here you can switch off some features of the tracer for faster tracing. Switching any of these off will produce a poorer
quality image but may be useful for rendering draft scenes quickly.
Trace Shadows
This switches the tracing of shadows on and off.
Use Shadow Cache
This switches the shadow cache on and off. With shadow cache on the tracing of shadows is faster, but uses more
memory.
Reflected Rays
With this option you can switch on and off the reflection. This will reduce trace times if you have objects in the scene
with reflective surfaces.
Refracted Rays
When switching this off transparent objects are not traced correctly anymore, but this could save a lot of time.
Specular Reflection
Here you can switch on and off the specular reflection of direct light sources.
Textures
With this option you switch off all texture effects, which can save also a lot of time.
Save
Report
With this option on the trace report will be saved after rendering. The file will be saved in the !MerlinDat directory in
!Report. This file is useful if you need to know statistics about the computation done by the raytracer - for instance
how long it took to render.
RGB
Switching this option on will save the traced picture in 24 bit format continuously during tracing. This format can be
read by Change-FSI. The file will be saved in the !MerlinDat directory in !RGB.
Sprite
With this option on the picture will be saved after tracing in 256 colour sprite format. The file will be saved in the
!MerlinDat directory in !Image.
Key shortcuts
F3 save file
F4 trace in preview type 1
SHIFT F4 trace in preview type 2
F5 trace in trace type 1
SHIFT F5 trace in trace type 2
F6 trace in user define mode
F9 display mode line
F10 display mode hidden line
F11 display mode gouraud shading
CTRL Z clear selection
CTRL G group all selected objects
CTRL U ungroup all selected objects
CTRL X delete all selected objects
Delete delete all selected objects
CTRL E center windows
CTRL J turn object into phong shaded
CTRL Y remove phong shading from object
CTRL Q turn polygons of object into double sided
CTRL N name group
CTRL O remove double sided polygons
CTRL T switch toolbox on / off
CTRL P switch parabox on / off
CTRL W clear scene
CTRL - activate measure tool
File formats
Merlin import format
MerlinEd allows you to import your own three dimensional data - whether produced by your own programs, a
database, or spreadsheet. You can for instance use MelinEd for scientific data visualization.
There are two examples supplied with the programm to show how you can use the Merlin import format. These are
!MakeFrac which uses the polyline function and !FracGen which uses polygons to create a fractal surface out of a
sprite.
General fromat rules
All keywords must be in upper case. Each parameter is separated by a space. All parameters which belong to one
keyword should be in one line (not separated with a newline). Numbers should not be in exponential format (1.56E-3).
The file type must be text (&FFF) and the first line must be:
MERLIN IMPORT V1.0 to identify the import format.
Surface
You can define your own object surfaces just like in the material editor. For this you need the keyword "SURFACE"
followed by a name, which must be less than 12 characters, and then followed by the surface attributes.
Syntax: SURFACE <name> <specular colour> <diffuse colour> <ambient colour> <transparency> <index of
refraction> <reflection> <coefficient> <translucent> <specular transmission coefficient>
If you want to give an object a surface that you have imported you add at the end of the line
"SURFACE <name>".
In one Merlin import you can define a maximum of 500 new surfaces.
You can use also the predefined surfaces. For this you must simply use the name of the predefined surface.
Polygon
The keyword is followed by a list of point numbers. The number of points is not limited, but it is recommended to have
a maximum of four points for each polygon. A polygon should have a minimum of three points. All points must lie in
the same plane - to make the polygon flat. When a point is specified by a negative number a move is made to that
point rather than drawing a line. This is similar to drawfile paths.
The points must be declared with POINTLIST before.
Syntax: POLYGON <point number> <point number> <point number>
Example: POLYGON 1 2 -3 4
Polyline
The keyword is followed by a list of point numbers. The number of points is not limited. When a point is specified by a
negative number a move is made to that point rather than drawing a line.
Syntax: POLYLINE <point number> <point number> <point number>
Example: POLYLINE 1 2 -3 4
Point list
Before you can declare polygons and lines you must define the points for them. This is done with the point list. After
the keyword you declare how many points you want to create. The first point has the index 1. Each point is separated
with newline. You can have more than one point list in an import file.
Syntax: POINTLIST <number of points>
<x1> <y1> <z1>
<x2> <y2> <z2>
... ... ...
Example: POINTLIST 3
1 3 4
-2 4 0
3 11 -0.5
Cone
Syntax: CONE <x-center> <y-center> <z-center> <x-dimension> <y-dimension> <z-dimension> <x-rotation> <y-
rotation> <z-rotation> <top radius> <bottom radius> [OPEN] [SURFACE name]
Sphere object
Sphere
Syntax: SPHERE <x-center> <y-center> <z-center> <x-dimension> <y-dimension> <z-dimension> <x-rotation> <y-
rotation> <z-rotation> [SURFACE name]
Box
Syntax: BOX <x-center> <y-center> <z-center> <x-dimension> <y-dimension> <z-dimension> <x-rotation> <y-
rotation> <z-rotation> [SURFACE name]
Draw file import
MerlinEd is able to import draw files. Simply drag a draw file over a merlin window or the icon on the icon bar to start
the import it. A window will appear where you can choose if there should be a certain distance between the polygons
loaded and if they should be connected. The drawfile import interprets filled paths as polygons but does not
understand sprite or font objects. You can convert fonts to filled paths by using that facility in Acorn's !Draw program.
You should be aware that since fonts contain alot of curves these may use up alot of memory and so only short
pieces of text are recommended.
DXF import format
The DXF format is a widespread CAD export / import format, which is originally used by AutoCAD. Currently only the
3D part of DXF is used by Merlin to import data. These are the objects VERTEX and 3DFACE. If you need others for
your import please contact us.
If you import large DXF files which contain 3DFACE's it could take a while.
High quality DXF files or 3D data can be purchased from:
Viewpoint Datalabs
870 West Center, Orem
UT 84057
USA
Phone: 801 229 3000
Fax: 801 229 3300
This company has a great library of 3D data. These incooperate aircraft, anatomy, animals, architecture, cars, people,
cycles, dinosaurs, geography, helicopters, landmarks, military vehicles, pick-ups (cars), sports, watercraft and motion
data.
If they don't have the data you require, they can help you also by creating it for you.
The average price for an object is around $400.
If you have internet access you can browse their World Wide Web site at "www.viewpoint.com"
Viewpoint are kindly hosting the famous Avalon repository of free 3D models which was previously held at the US
navy site chinalake.
Merlin copy path format
This is a supplement to the multicopy tool. It processes all selected objects. You can specify the path on which the
selected objects are copied to. The copying starts relative from the original position of the selection. So the first point
of your path will not affect the position of the objects, but the relative movement will change the position of the objects.
The coordinates you give should be in absolute coordinate format.
The objects can also be rotated. This will be added to the current orientation of the object.
To activate the copy path tool you simply select the objects you want to copy and drag the copy path text file to the
Merlin application.
The file type must be text format (&FFF = Text).
Format:
MERLIN COPYPATH V1.0 first line of file, followed by a list of translations
TRANSLATE <X> <Y> <Z> <X-rotation> <Y-rotation> <Z-rotation> <X-scale> <Y-scale> <Z-scale>
TRANSLATE 0 0 0 0 0 0 1 1 1 start point
TRANSLATE 1 0 0 45 0 0 1 1 1 add 1 in x pos. turn 45° around x-axe
TRANSLATE 1 -1 2 10 0 0 1.5 1.5 1.5 subtract -1 in y pos. and add 2 in z pos, turn 10° around x-axe
scale object by factor 1.5
RGB files
The most important output file is the RGB file and is continuously being updated during tracing. The RGB file enables
the scene to be traced in more than one section, so you dont have to wait for the trace to finish before doing
something else. The file consists of a header line terminated by a newline character (13) followed by triplets of bytes.
The header line contains three integers each followed by a single space, and an identity string. The integers are the X
resolution (Xres), Y resolution (Yres), and the tracing Mode. The identity string states the author of the program and
the time the file was created. Xres and Yres determine the maximum number of byte triplets that follow, (Xres * Yres).
The three bytes are the red, green and blue components of the pixel and are in the range 0-255. The first Xres triplets
make up the top line of the image from left to right, the next Xres triplets constitute the next line down, etc. The 24 bits
per pixel means a possible 16.7 million colours, enabling the RGB file to be used to create a perfectly smooth image
on computers with this capability.
Colour Map files
A colour map file contains 256 lines of text (each terminated by a new line character). Each line consists of three
integers in the range 0-255, each separated by a single space. The three integers indicate the red,green and blue
components of a colour. This is used by the texture mapping functions. A point on the surface of an object is given an
intensity value (n) in the range 0-255. The colour used at this point is then taken from the n'th line of the file.